package com.poobo.service.impl;

import java.io.File;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.poobo.dao.IEquipmentDao;
import com.poobo.entity.TbEquipment;
import com.poobo.service.IEquipmentService;
import com.poobo.util.pager.Page;

@Service
@Transactional
public class EquipmentServiceImpl implements IEquipmentService{
	@Autowired
	private IEquipmentDao equipmentDao;
	public IEquipmentDao getEquipmentDao() {
		return equipmentDao;
	}
	public void setEquipmentDao(IEquipmentDao equipmentDao) {
		this.equipmentDao = equipmentDao;
	}
	
	@Override
	public TbEquipment queryEquipmentById(Integer id) {
		return equipmentDao.queryEquipmentById(id);
	}
	@Override
	public Page equipmentList(TbEquipment equipment, Page page) {
		return equipmentDao.queryEquipmentPage(equipment, page);
	}
	@Override
	public void deleteEquipmentById(Integer id) {
		equipmentDao.deleteEquipmentById(id);
	}
	@Override
	public void saveEquipment(TbEquipment equipment) {
		equipmentDao.saveEquipment(equipment);
	}
	@Override
	public void saveEquipmentExcel(File file) {
		List<TbEquipment> equipments = equipmentDao.queryAll();
		equipmentDao.saveEquipmentExcel(equipments,file);
	}
	@Override
	public List<TbEquipment> queryAll() {
		return equipmentDao.queryAll();
	}
	@Override
	public List<TbEquipment> querySome() {
		return equipmentDao.querySome();
	}
	@Override
	public TbEquipment queryEquipmentByNumber(String number) {
		return equipmentDao.queryEquipmentByNumber(number);
	}
	@Override
	public String queryAndSaveByNumber(String number) {
		TbEquipment equipment = equipmentDao.queryEquipmentByNumber2(number);
		if( equipment != null ){}
		return null;
	}
	@Override
	public List<TbEquipment> queryNotConfigGameEqupments() {
		return equipmentDao.queryNotConfigGameEqupments();
	}

}
